home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The PC-SIG Library 10
/
The PC-Sig Library - Shareware for the IBM PC and Compatibles (PC-SIG)(Tenth Edition Disks 1-2804)(1991).iso
/
PC_SIGCD
/
07
/
8
/
DISK0786.ZIP
/
TOOLS1.ARC
/
PASSWORD.BAS
< prev
next >
Wrap
BASIC Source File
|
1987-03-09
|
2KB
|
65 lines
1000 '=========================================================
1010 'PASSWORD.BAS (From "Softalk", March, May & July, 1984)
1020 'minor mods and color added by P. Eskildsen, July 10, 1984
1030 'other mods and color removed by Dan Gookin, March 5th, 1987
1040 'Uses BASICA 2.0 key trapping to kill Ctrl-Alt-Del,
1050 'Ctrl-C, & Ctrl-Break -- user cannot RESET
1060 '
1070 KEY OFF
1080 KEY 15,CHR$(12) + CHR$(83) 'CTRL-ALT-DEL
1090 KEY 16,CHR$(4) + CHR$(46) 'CTRL-C
1100 KEY 17,CHR$(4) + CHR$(70) 'CTRL-BREAK
1110 ON KEY(15) GOSUB 1520 : KEY(15) ON
1120 ON KEY(16) GOSUB 1520 : KEY(16) ON
1130 ON KEY(17) GOSUB 1520 : KEY(17) ON
1140 '
1150 'Read in password
1160 '
1170 OPEN "password.dat" FOR INPUT AS 1
1180 LINE INPUT#1,PASSWORD$
1190 CLOSE
1200 ON ERROR GOTO 1620
1210 '
1220 'Check user's password entry one char at a time, as entered:
1230 '
1240 CLS
1250 LOCATE ,,1
1260 PRINT "Please enter your password:";
1270 TRY = 0
1280 I = 0
1290 A$ = INKEY$: IF A$="" THEN 1290
1300 IF A$ = "~" THEN 1420
1310 I = I + 1
1320 IF A$ <> MID$(PASSWORD$,I,1) THEN 1350
1330 IF I = LEN(PASSWORD$) THEN 1420
1340 GOTO 1290
1350 TRY = TRY + 1
1360 IF TRY >= 3 THEN 1480
1370 PRINT "Wrong! Try again from start of password."
1380 GOTO 1280
1390 '
1400 'Access granted
1410 '
1420 PRINT
1430 PRINT TAB(30);"Welcome!"
1440 SYSTEM
1450 '
1460 'Too many attempts, lock system
1470 '
1480 CLS
1490 LOCATE 12,20
1500 PRINT "** System Locked **"
1510 GOTO 1510
1520 '
1530 'Display ignore messages
1540 '
1550 BEEP
1560 READ AH$
1570 PRINT AH$
1580 RETURN
1590 DATA "So there!", "Think you're smart?"
1600 DATA "That won't work either.", "I'm sorry"
1610 DATA "Try harder...", "Okay. Give up now."
1620 RESTORE 1590
1630 RESUME 1560